﻿using System;
using System.Collections.ObjectModel;
using Coniometer.Model;
using Prism.Mvvm;

namespace Coniometer.ViewModels
{
    public class PrintSchemePageViewModel : BindableBase
    {
        private ObservableCollection<PrintSchemeModel> _schemeCollection = new ObservableCollection<PrintSchemeModel>();

        public ObservableCollection<PrintSchemeModel> SchemeCollection
        {
            get => _schemeCollection;
            set
            {
                _schemeCollection = value;
                RaisePropertyChanged();
            }
        }

        public PrintSchemePageViewModel()
        {
            for (var i = 1; i < 15; i++)
            {
                var model = new PrintSchemeModel
                {
                    SchemeName = "打印方案名称123",
                    SimpleName = $"样品-{i}",
                    AverageValue = Math.Round(new Random().NextDouble() * 100, 2),
                    Difference = Math.Round(new Random().NextDouble() * 100, 2),
                    SumAverage = Math.Round(new Random().NextDouble() * 100, 2),
                    Maximum = i * 100,
                    SerialNumber = Guid.NewGuid().ToString().Replace("-", "").ToUpper().Substring(0, 10),
                    Ucl = "UCL",
                    JudgmentResult = "判定结果"
                };
                SchemeCollection.Add(model);
            }
        }
    }
}